# general settings
set -g set-titles on
set -g set-titles-string '#T'
set -g default-terminal "xterm-256color"
set -g escape-time 0
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -g focus-events on
set -g history-limit 100000
set -g history-file $HOME/.local/share/tmux/history
set -g monitor-activity off
set -g visual-activity off
setw -g monitor-bell off
set -g bell-action none
set -g set-clipboard on
setw -g mode-keys vi
setw -g wrap-search off

set -g prefix C-a # change default leader key
bind C-a send-prefix

# unbind keys
unbind j
unbind C-b  # unbind default leader key
unbind '"'  # unbind horizontal split
unbind %    # unbind horizontal split

# reload configuration
bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded!"

# window
set -g base-index 1
set -g renumber-windows on
setw -g automatic-rename on
bind C-c new-window
bind A command-prompt "rename-window %%"
bind-key c split-window -v # split window horizontally
bind-key v split-window -h # split window vertically

# panes
setw -g aggressive-resize on
bind-key space list-panes
bind-key Enter break-pane
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key -r C-h resize-pane -L
bind-key -r C-j resize-pane -D
bind-key -r C-k resize-pane -U
bind-key -r C-l resize-pane -R

# interfaces
set -g status-position bottom
set -g status on
set -g status-interval 5
set -g status-style "fg=white,bold, bg=#262626"

## left
set -g status-left-length 40
set -g status-left "#[fg=black,bold,bg=blue]   "
set -g window-status-format "#[fg=white,bold,bg=#262626] #I #W "
set -g window-status-current-format "#[fg=blue,bg=#3A3A3A] #I #[fg=cyan,bg=#3A3A3A]#W "
set -g status-justify left

## right
set -g status-right-length 40
set -g status-right '#[fg=yellow,bg=#3A3A3A] ﲾ #[fg=white,bg=#3A3A3A]#S #[bg=#87AFAF] #[fg=colour0,bold] %R '

# panes
set -g pane-border-style "fg=#3A3A3A"
set -ag pane-active-border-style "fg=#3A3A3A"

# message
set -g message-style "fg=white,bg=#3A3A3A"
set -g message-command-style "fg=white,bg=#3A3A3A"
